/// project_save_particles()

json_save_object_start("particles")

	json_save_var_bool("spawn_constant", pc_spawn_constant)
	json_save_var("spawn_amount", pc_spawn_amount)

	json_save_var_bool("spawn_region_use", pc_spawn_region_use)
	json_save_var("spawn_region_type", pc_spawn_region_type)
	json_save_var("spawn_region_sphere_radius", pc_spawn_region_sphere_radius)
	json_save_var("spawn_region_cube_size", pc_spawn_region_cube_size)
	json_save_var_point3D("spawn_region_box_size", pc_spawn_region_box_size)

	json_save_var("bounding_box_type", pc_bounding_box_type)
	json_save_var("bounding_box_ground_z", pc_bounding_box_ground_z)
	json_save_var_point3D("bounding_box_custom_start", pc_bounding_box_custom_start)
	json_save_var_point3D("bounding_box_custom_end", pc_bounding_box_custom_end)
	json_save_var_bool("bounding_box_relative", pc_bounding_box_relative)

	json_save_var_bool("destroy_at_animation_finish", pc_destroy_at_animation_finish)
	json_save_var_bool("destroy_at_amount", pc_destroy_at_amount)
	json_save_var("destroy_at_amount_val", pc_destroy_at_amount_val)
	json_save_var_bool("destroy_at_time", pc_destroy_at_time)
	json_save_var("destroy_at_time_seconds", pc_destroy_at_time_seconds)
	json_save_var_bool("destroy_at_time_israndom", pc_destroy_at_time_israndom)
	json_save_var("destroy_at_time_random_min", pc_destroy_at_time_random_min)
	json_save_var("destroy_at_time_random_max", pc_destroy_at_time_random_max)
	json_save_var("destroy_at_bounding_box", pc_destroy_at_bounding_box)
	
	json_save_array_start("types")
	
		for (var t = 0; t < ds_list_size(pc_type_list); t++) 
		{
			json_save_object_start()
			
			with (pc_type_list[|t])
			{
				json_save_var("id", save_id)
				json_save_var("name", json_string_encode(name))
				
				if (temp = particle_sheet)
					json_save_var("temp_type", "sheet")
				else if (temp = particle_template)
					json_save_var("temp_type", "template")
				else 
					json_save_var("temp_type", "templateobj")
				
				if (temp)
					json_save_var_save_id("temp", temp)
				
				json_save_var("text", json_string_encode(text))
				json_save_var("spawn_rate", spawn_rate)
				
				json_save_var_save_id("sprite_tex", sprite_tex)
				json_save_var("sprite_tex_image", sprite_tex_image)
				json_save_var_save_id("sprite_template_tex", sprite_template_tex)
				json_save_var("sprite_template", sprite_template)
				json_save_var_bool("sprite_template_still_frame", sprite_template_still_frame)
				json_save_var_bool("sprite_template_random_frame", sprite_template_random_frame)
				json_save_var_bool("sprite_template_reverse", sprite_template_reverse)
				json_save_var("sprite_frame_width", sprite_frame_width)
				json_save_var("sprite_frame_height", sprite_frame_height)
				json_save_var("sprite_frame_start", sprite_frame_start)
				json_save_var("sprite_frame_end", sprite_frame_end)
				json_save_var("sprite_animation_speed", sprite_animation_speed)
				json_save_var_bool("sprite_animation_speed_israndom", sprite_animation_speed_israndom)
				json_save_var("sprite_animation_speed_random_min", sprite_animation_speed_random_min)
				json_save_var("sprite_animation_speed_random_max", sprite_animation_speed_random_max)
				json_save_var("sprite_animation_onend", sprite_animation_onend)
				
				json_save_var_bool("angle_extend", angle_extend)
				json_save_var_point3D("angle", angle)
				json_save_var_point3D("angle_israndom", angle_israndom)
				json_save_var_point3D("angle_random_min", angle_random_min)
				json_save_var_point3D("angle_random_max", angle_random_max)
				json_save_var("angle_speed", angle_speed)
				json_save_var("angle_speed_israndom", angle_speed_israndom)
				json_save_var("angle_speed_random_min", angle_speed_random_min)
				json_save_var("angle_speed_random_max", angle_speed_random_max)
				json_save_var("angle_speed_add", angle_speed_add)
				json_save_var("angle_speed_add_israndom", angle_speed_add_israndom)
				json_save_var("angle_speed_add_random_min", angle_speed_add_random_min)
				json_save_var("angle_speed_add_random_max", angle_speed_add_random_max)
				json_save_var("angle_speed_mul", angle_speed_mul)
				json_save_var("angle_speed_mul_israndom", angle_speed_mul_israndom)
				json_save_var("angle_speed_mul_random_min", angle_speed_mul_random_min)
				json_save_var("angle_speed_mul_random_max", angle_speed_mul_random_max)
				
				json_save_var_bool("spd_extend", spd_extend)
				json_save_var_point3D("spd", spd)
				json_save_var_point3D("spd_israndom", spd_israndom)
				json_save_var_point3D("spd_random_min", spd_random_min)
				json_save_var_point3D("spd_random_max", spd_random_max)
				json_save_var_point3D("spd_add", spd_add)
				json_save_var_point3D("spd_add_israndom", spd_add_israndom)
				json_save_var_point3D("spd_add_random_min", spd_add_random_min)
				json_save_var_point3D("spd_add_random_max", spd_add_random_max)
				json_save_var_point3D("spd_mul", spd_mul)
				json_save_var_point3D("spd_mul_israndom", spd_mul_israndom)
				json_save_var_point3D("spd_mul_random_min", spd_mul_random_min)
				json_save_var_point3D("spd_mul_random_max", spd_mul_random_max)
			
				json_save_var_bool("rot_extend", rot_extend)
				json_save_var_point3D("rot", rot)
				json_save_var_point3D("rot_israndom", rot_israndom)
				json_save_var_point3D("rot_random_min", rot_random_min)
				json_save_var_point3D("rot_random_max", rot_random_max)
				
				json_save_var_bool("rot_spd_extend", rot_spd_extend)
				json_save_var_point3D("rot_spd", rot_spd)
				json_save_var_point3D("rot_spd_israndom", rot_spd_israndom)
				json_save_var_point3D("rot_spd_random_min", rot_spd_random_min)
				json_save_var_point3D("rot_spd_random_max", rot_spd_random_max)
				json_save_var_point3D("rot_spd_add", rot_spd_add)
				json_save_var_point3D("rot_spd_add_israndom", rot_spd_add_israndom)
				json_save_var_point3D("rot_spd_add_random_min", rot_spd_add_random_min)
				json_save_var_point3D("rot_spd_add_random_max", rot_spd_add_random_max)
				json_save_var_point3D("rot_spd_mul", rot_spd_mul)
				json_save_var_point3D("rot_spd_mul_israndom", rot_spd_mul_israndom)
				json_save_var_point3D("rot_spd_mul_random_min", rot_spd_mul_random_min)
				json_save_var_point3D("rot_spd_mul_random_max", rot_spd_mul_random_max)
				
				json_save_var("sprite_angle", sprite_angle)
				json_save_var_bool("sprite_angle_israndom", sprite_angle_israndom)
				json_save_var("sprite_angle_random_min", sprite_angle_random_min)
				json_save_var("sprite_angle_random_max", sprite_angle_random_max)
				json_save_var("sprite_angle_add", sprite_angle_add)
				json_save_var_bool("sprite_angle_add_israndom", sprite_angle_add_israndom)
				json_save_var("sprite_angle_add_random_min", sprite_angle_add_random_min)
				json_save_var("sprite_angle_add_random_max", sprite_angle_add_random_max)
				
				json_save_var("scale", scale)
				json_save_var_bool("scale_israndom", scale_israndom)
				json_save_var("scale_random_min", scale_random_min)
				json_save_var("scale_random_max", scale_random_max)
				json_save_var("scale_add", scale_add)
				json_save_var_bool("scale_add_israndom", scale_add_israndom)
				json_save_var("scale_add_random_min", scale_add_random_min)
				json_save_var("scale_add_random_max", scale_add_random_max)
		
				json_save_var("alpha", alpha)
				json_save_var_bool("alpha_israndom", alpha_israndom)
				json_save_var("alpha_random_min", alpha_random_min)
				json_save_var("alpha_random_max", alpha_random_max)
				json_save_var("alpha_add", alpha_add)
				json_save_var_bool("alpha_add_israndom", alpha_add_israndom)
				json_save_var("alpha_add_random_min", alpha_add_random_min)
				json_save_var("alpha_add_random_max", alpha_add_random_max)
		
				json_save_var_color("color", color)
				json_save_var_bool("color_israndom", color_israndom)
				json_save_var_color("color_random_start", color_random_start)
				json_save_var_color("color_random_end", color_random_end)
				json_save_var_bool("color_mix_enabled", color_mix_enabled)
				json_save_var_color("color_mix", color_mix)
				json_save_var_bool("color_mix_israndom", color_mix_israndom)
				json_save_var_color("color_mix_random_start", color_mix_random_start)
				json_save_var_color("color_mix_random_end", color_mix_random_end)
				json_save_var("color_mix_time", color_mix_time)
				json_save_var_bool("color_mix_time_israndom", color_mix_time_israndom)
				json_save_var("color_mix_time_random_min", color_mix_time_random_min)
				json_save_var("color_mix_time_random_max", color_mix_time_random_max)
		
				json_save_var_bool("spawn_region", spawn_region)
				json_save_var_bool("bounding_box", bounding_box)
				json_save_var_bool("bounce", bounce)
				json_save_var("bounce_factor", bounce_factor)
				json_save_var_bool("orbit", orbit)
			}
			
			json_save_object_done()
		}
	
	json_save_array_done()

json_save_object_done()